home *** CD-ROM | disk | FTP | other *** search
/ Sounds Terrific 1 / Sounds Terrific CD (1994)(Weird Science)(Disc 2 of 2)[!][Amiga-PC].iso / modules / d / donation.mod < prev    next >
Encoding:
Text File  |  1994-08-04  |  11.4 KB  |  333 lines

  1. DONATION.MOD
  2. Virus #1 @9813
  3. Thu Nov 28 02:12:33 1991
  4. ┌────────────────────────────────────────────────────────────────────────────┐
  5. │ Mod Name: DONATION.MOD                  Mod Author: Virus 1@9813           │
  6. │ Difficulty: █████▒                      Date: 11/27/1991                   │
  7. │ WWIV Version: 4.2                                                          │
  8. │ Description: Adds DONATION information in User Record and shows at logon,  │
  9. │              and in uedit. Official MoD Release                            │
  10. └────────────────────────────────────────────────────────────────────────────┘
  11.  
  12. Basically what this does is adds a donation field and shows them how much
  13. they donated when the logon, when displaying their information, and in uedit.
  14.  
  15. Legend:
  16.   = Search for
  17.   + Add
  18.   - Delete
  19.   % Change
  20.  
  21. 1) VARDEC.H
  22.  
  23. =  sysopsub,               /* sysop sub board number */
  24. %  ontoday,                /* num times on today */  /* Change the ; to , */
  25. +  donation;               /* amount of money donated */  /* Add this line */
  26. Save VARDEC.H
  27.  
  28. 2) UEDIT.C
  29.  
  30. In void print_data(blah blah) at the end
  31.  
  32. =    npr("Rest: %s\r\n",s2);
  33. =  if (u->wwiv_regnum)
  34. =    npr("WWIV: %ld\r\n", u->wwiv_regnum);
  35. +  if (u->donation)
  36.      npr("Donated: $%d.00\r\n", u->donation);
  37.  
  38. Search for void uedit(blah blah)
  39.  
  40. =  prt(2,"Uedit : ");
  41. =  if ((thisuser.sl==255) || (wfc))
  42. %    ch=onek("Q[]{}/,.?UDRNLCPOGMSTEYZAI~:12345");  /* NOTE */
  43. =  else
  44. %    ch=onek("Q[]{}/,.?UDRNLCPOGMSTEYZAI12345");    /* NOTE */
  45.  
  46. Now right below this code there will be some case statements.  Go to the last
  47. case and right after the 'break;' add the following... (Mine is different
  48. cause I added some cases so I don't know what it should really be.)
  49.  
  50. NOTE:  You may or may not have as many commands as I do.  So your will look
  51.        different from mine.  Just add a number or letter that isn't already
  52.        used.
  53.  
  54. =    break;
  55. +  case '5':
  56. +    nl();
  57. +    prt(2,"Enter Donation Total: ");
  58. +    input(s,3);
  59. +    i=atoi(s);
  60. +    u.donation=i;
  61. +    write_user(un,&u);
  62. +    break;
  63. =}
  64.  
  65. 3) LILO.C
  66.  
  67. Search for void logon()
  68.  
  69. =  if (thisuser.ontoday==1)
  70. =    npr("Last on        : %s\r\n",thisuser.laston);
  71. =  else
  72. =    npr("Times on today : %d\r\n",thisuser.ontoday);
  73. +  npr("Money Donated    : $%d.00\r\n",thisuser.donation);
  74. =  npr("Sysop is       : %sAvailable\r\n",sysop2()?"":"NOT ");
  75.  
  76. 4) BBSUTL.C
  77.  
  78. Search for void yourinfo()
  79.  
  80. =  npr("Time spent on  : %ld Minutes\r\n", (long)
  81. =    ((thisuser.timeon+timer()-timeon)/60.0));
  82. +  npr("Money Donated  : $%d.00",thisuser.donation");
  83. =  nl();
  84.  
  85. 5)  That's the whole mod.  Now you have to use the following convert program
  86. to change your userlist to work properly.  If you are in WWIVnet then read
  87. the docs about the NETINIT and whatnot.  I'm not exactly sure how to do it
  88. with the net, but the docs tell you what to do.  I have to read them myself.
  89.  
  90. 6)Now, Put the following in a file called OLD.H
  91.  
  92. typedef struct {
  93.     char        name[31],        /* user's name */
  94.             realname[21],        /* user's real name */
  95.             callsign[7],        /* user's amateur callsign */
  96.             phone[13],        /* user's phone number */
  97.             pw[9],            /* user's password */
  98.             laston[9],        /* last date on */
  99.             firston[9],        /* first date on */
  100.             note[41],        /* sysop's note about user */
  101.             macros[3][81],        /* macro keys */
  102.             sex;            /* user's sex */
  103.     unsigned char    age,            /* user's age */
  104.             inact,            /* if deleted or inactive */
  105.             comp_type,        /* computer type */
  106.             defprot,        /* deflt transfer protocol */
  107.             defed,            /* default editor */
  108.             screenchars,screenlines,/* screen size */
  109.             sl,            /* security level */
  110.             dsl,            /* transfer security level */
  111.             exempt,            /* exempt from ratios, etc */
  112.             colors[8],        /* user's colors */
  113.             votes[20],        /* user's votes */
  114.             illegal,        /* illegal logons */
  115.             waiting,        /* number mail waiting */
  116.             sysopsub,        /* sysop sub board number */
  117.             ontoday;        /* num times on today */
  118.     unsigned short    homeuser,homesys,    /* where user can be found */
  119.             forwardusr,forwardsys,    /* where to forward mail */
  120.             msgpost,        /* number messages posted */
  121.             emailsent,        /* number of email sent */
  122.             feedbacksent,        /* number of f-back sent */
  123.             posttoday,        /* number posts today */
  124.             etoday,            /* number emails today */
  125.             ar,            /* board access */
  126.             dar,            /* directory access */
  127.             restrict,        /* restrictions on account */
  128.             ass_pts,        /* bad things the user did */
  129.             uploaded,        /* number files uploaded */
  130.             downloaded,        /* number files downloaded */
  131.             lastrate,        /* last baud rate on */
  132.             logons;            /* total number of logons */
  133.     unsigned long    msgread,        /* total num msgs read */
  134.             uk,            /* number of k uploaded */
  135.             dk,            /* number of k downloaded */
  136.             qscn,            /* which subs to n-scan */
  137.             qscnptr[33],            /* q-scan pointers */
  138.             nscn1,nscn2,        /* which dirs to n-scan */
  139.             daten,            /* numerical time last on */
  140.             sysstatus;        /* status/defaults */
  141.     float        timeontoday,        /* time on today */
  142.             extratime,        /* time left today */
  143.             timeon,            /* total time on system */
  144.             pos_account,        /* $ credit */
  145.             neg_account,        /* $ debit */
  146.             gold;            /* game money */
  147.     unsigned char    bwcolors[8];        /* b&w colors */
  148.     unsigned char    month,day,year;        /* user's birthday */
  149.     unsigned int    emailnet,        /* email sent into net */
  150.             postnet;        /* posts sent into net */
  151.     unsigned short    fsenttoday1;        /* feedbacks today */
  152.     unsigned char   num_extended;           /* num lines of ext desc */
  153.     unsigned char   optional_val;           /* optional lines in msgs */
  154.     unsigned long   wwiv_regnum;            /* users WWIV reg number */
  155.     char            res[29];                /* reserved bytes */
  156.     unsigned long   qscn2;                  /* additional qscan ptr */
  157.     unsigned long   qscnptr2[64-32];  /* additional quickscan ptrs */
  158. } olduserrec;
  159.  
  160. 7) Block read this next part into a NEW file and call it CONVERT.C and
  161. compile it.  This compile program is Black Dragon's, only modified to suit
  162. the changes.
  163.  
  164. /*  CONVERT USERLIST PROGRAM */
  165.  
  166. /*  Written by The Black Dragon, 1989 */
  167. /*  (C) 1989 Black Dragon Enterprises */
  168. /*  Compiled and tested using Borland Turbo C - Version 1.5 */
  169. /*  License granted to freely distribute without compensation and to */
  170. /*  modify as needed "to get the job done."  Use at your own risk.  */
  171. /*  Distributed "as is".  No warranty or guarentee */
  172.  
  173. /*  Command Parameters:  */
  174. /*  CONVERT  <old user filename>  <new user filename>  */
  175.  
  176.  
  177. #include <stdio.h>
  178. #include <string.h>
  179. #include <mem.h>
  180. #include <io.h>
  181. #include <fcntl.h>
  182. #include <sys\stat.h>
  183. #include "old.h"                        /* put your old userlist here and */
  184. #include "vardec.h"                     /* rename it from userrec to olduserrec */
  185.  
  186. void main(int argc, char *argv[])
  187. {
  188.   int f,g,i;
  189.   unsigned int loop,num=0;
  190.   unsigned long len;
  191.   userrec new;
  192.   olduserrec old;
  193.  
  194.   if (argc<3) {
  195.     printf("\nRequires 2 parameters.\n");
  196.     printf("Usage: CONVERT oldfile newfile \n");
  197.     abort();
  198.   }
  199.   if ((f=open(argv[1],O_RDWR|O_BINARY,S_IREAD|S_IWRITE))<=0) {
  200.     printf("\nCould not open user list %s\n",argv[1]);
  201.     abort();
  202.   }
  203.   if ((g=open(argv[2],O_RDWR|O_BINARY|O_CREAT|O_TRUNC,S_IREAD|S_IWRITE))<=0) {
  204.     printf("\nCould not open output file %s\n",argv[2]);
  205.     abort();
  206.   }
  207.   printf("\n\nSize of old user record %d",sizeof(olduserrec));
  208.   printf("\nSize of new user record %d\n\n",sizeof(userrec));
  209.  
  210.   len=filelength(f);
  211.   num=(len/sizeof(olduserrec))+!(len%sizeof(olduserrec));
  212.   for (loop=0;loop<num;loop++) {
  213.     if (sizeof(olduserrec)==read(f,&old,sizeof(olduserrec))) {
  214.       printf("\015Processing user #%u of %u",loop,num-1);
  215.  
  216.       memset(&new,0,sizeof(userrec));         /* Nice to clear out garbage */
  217.       strcpy(new.name,old.name);                  /* Now copy all data over    */
  218.       strcpy(new.realname,old.realname);
  219.       strcpy(new.callsign,old.callsign);  /* Added this one */
  220.       strcpy(new.phone,old.phone);        /* added this one also */
  221.       strcpy(new.pw,old.pw);
  222.       strcpy(new.laston,old.laston);
  223.       strcpy(new.firston,old.firston);
  224.       strcpy(new.note,old.note);
  225.       for (i=0;i<3;i++)
  226.     strcpy(new.macros[i],old.macros[i]);
  227.       new.sex=old.sex;
  228.       new.age=old.age;
  229.       new.inact=old.inact;
  230.       new.comp_type=old.comp_type;
  231.       new.defprot=old.defprot;
  232.       new.defed=old.defed;
  233.       new.screenchars=old.screenchars;
  234.       new.screenlines=old.screenlines;
  235.       new.sl=old.sl;
  236.       new.dsl=old.dsl;
  237.       new.exempt=old.exempt;
  238.       for (i=0;i<8;i++)
  239.     new.colors[i]=old.colors[i];
  240.       for (i=0;i<20;i++)
  241.     new.votes[i]=old.votes[i];
  242.       new.illegal=old.illegal;
  243.       new.waiting=old.waiting;
  244.       new.sysopsub=old.sysopsub;
  245.       new.ontoday=old.ontoday;
  246.       new.homeuser=old.homeuser;
  247.       new.homesys=old.homesys;
  248.       new.forwardusr=old.forwardusr;
  249.       new.forwardsys=old.forwardsys;
  250.       new.msgpost=old.msgpost;
  251.       new.emailsent=old.emailsent;
  252.       new.feedbacksent=old.feedbacksent;
  253.       new.posttoday=old.posttoday;
  254.       new.etoday=old.etoday;
  255.       new.ar=old.ar;
  256.       new.dar=old.dar;
  257.       new.restrict=old.restrict;
  258.       new.ass_pts=old.ass_pts;
  259.       new.uploaded=old.uploaded;
  260.       new.downloaded=old.downloaded;
  261.       new.lastrate=old.lastrate;
  262.       new.logons=old.logons;
  263.       new.msgread=old.msgread;
  264.       new.uk=old.uk;
  265.       new.dk=old.dk;
  266.       new.qscn=old.qscn;                              /* copies existing n-scan ptrs */
  267.       for(i=0;i<33;i++)
  268.     new.qscnptr[i]=old.qscnptr[i];
  269.       new.nscn1=old.nscn1;
  270.       new.nscn2=old.nscn2;
  271.       new.daten=old.daten;
  272.       new.sysstatus=old.sysstatus;
  273.       new.timeontoday=old.timeontoday;
  274.       new.extratime=old.extratime;
  275.       new.timeon=old.timeon;
  276.       new.pos_account=old.pos_account;
  277.       new.neg_account=old.neg_account;
  278.       new.gold=old.gold;
  279.       new.donation=0L;
  280.       for (i=0;i<8;i++)
  281.     new.bwcolors[i]=old.bwcolors[i];
  282.       new.month=old.month;
  283.       new.day=old.day;
  284.       new.year=old.year;
  285.       new.emailnet=old.emailnet;
  286.       new.postnet=old.postnet;
  287.       new.fsenttoday1=old.fsenttoday1;
  288.       new.num_extended=old.num_extended;
  289.       new.optional_val=old.optional_val;
  290.       new.wwiv_regnum=old.wwiv_regnum;
  291.       for (i=0;i<29;i++)
  292.      new.res[i]=old.res[i];
  293.       new.qscn2=old.qscn2;
  294.       for (i=0;i<MAX_SUBS-32;i++)
  295.     new.qscnptr2[i]=old.qscnptr2[i];
  296.       write(g,&new,sizeof(userrec));          /* User record converted here */
  297.     }
  298.   }
  299.   close(f);
  300.   close(g);
  301. }
  302.  
  303. 8) Copy CONVERT.EXE to your main bbs dir.
  304.  
  305. 9) If your in WWIVnet then follow this step and #11, else skip em.
  306.  
  307.    Load up NETINIT.C (Comes with the network software) and compile it.  If
  308.    you use an old version, then it won't work, cause when you compile this,
  309.    it reads VARDEC.H and you modified that, so this must know the changes.
  310.  
  311. 10) Copy NETINIT.EXE into your WWIV dir.
  312.  
  313. 11) Compile your BBS.
  314.  
  315. 12) Copy BBS.EXE and RETURN.EXE to your WWIV dir.
  316.  
  317. 13) Run NETINIT.EXE.
  318.  
  319. 14) Backup your wwiv and data dirs for safety measures.
  320.  
  321. 15) In your wwiv dir, run CONVERT.EXE.
  322.  
  323. 16) Now your all done!!!.  Ppppphhhheeeeewwwwww.
  324.  
  325. 17) All you have to do now, is when someone donates money, just simply go
  326.     into UEDIT and press the appropiate command.  (Mine is 5) and your all
  327.     set.
  328.  
  329. If you have any questions, please feel free to E-Mail me at 1@9813.
  330.  
  331. Also, if you are using this mod, or even considered using it, I'd like to
  332. know that my mod is being used by someone other than me.  Thanks...
  333.